import PySimpleGUI as sg
from utils.settings import MENU_ITEM, ICO_FILE

def _create_window():
    '''创建主程序的Window窗口'''
    # 菜单项定义
    # Default is Dark Blue 3
    menu_items = [['窗体皮肤', MENU_ITEM]]

    # window窗口的界面元素
    layout = [[sg.Menu(menu_items, tearoff=True, key='-THEMES-')],
              [sg.Frame(title='选择排考文件', layout=[
                [
                    sg.Text('工 作 薄：'),
                    sg.Input(size=(38, 1),
                             key='-FILE-',
                             readonly=True,
                             enable_events=True),
                    sg.FileBrowse(button_text='选择',
                                  file_types=(("Excel文件", "*.xlsx"), 
                                             ("旧版Excel", "*.xls")),
                                  target='-FILE-')
                ],
                [
                    sg.Text('Sheet表：'),
                    sg.Combo(values=['-请选择-'],
                             s=(14, 1),
                             key='-SHEET-',
                             readonly=True,
                             default_value='-请选择-',
                             enable_events=True)
                ]])
              ],
              [
                sg.Button(button_text='确定', size=(6, 1)),
                sg.Button('关闭', size=(6, 1))
              ],
              [sg.Text('_' * 90)],
              [sg.Text('文件夹路径：')],
              [sg.Listbox(values=[], key='-DIREC-', size=(60, 20))]]

    # Create the Window
    window = sg.Window(title='【教育技术中心】批量创建文件夹v2',
                       layout=layout,
                       font=("DengXian", 14),
                       size=(600, 400),
                       icon=ICO_FILE,
                       enable_close_attempted_event=True)
    return window